import { Icon, Flex, Text } from '@aws-amplify/ui-react';
import { MdAnnouncement } from 'react-icons/md';

export const AccessibilityIconExample = () => (
  <Flex direction="column" alignItems="flex-start">
    {/* Icon labeled via aria-label */}
    <Icon
      ariaLabel="Close"
      pathData="M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z"
    />

    {/* Icon labeled via SVG <title></title> element */}
    <Icon>
      <title>Document</title>
      <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"></path>
    </Icon>

    {/* 
      Decorative Icon, hidden from the accessibility tree 
      because it is accompanied by descriptive text. 
    */}
    <Flex gap="xxxs" alignItems="center">
      <Icon as={MdAnnouncement} aria-hidden="true" /> <Text>Announcement</Text>
    </Flex>
  </Flex>
);
